package com.zhanghe.study;

import com.zhanghe.ribbonrule.MyRuleConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.ribbon.RibbonClient;

/**
 * @author zh
 * @date 2021/8/19 14:25
 */
@SpringBootApplication
@EnableEurekaClient
// 配置自定义的负载均衡类，只针对于某个微服务有效
// 这个自定义的负载均衡类不可以在@ComponentScan所能扫描的包下，否则这个自定义的负载均衡算法就会被所有的Ribbon客户端所共享，无法达到对于某个微服务定制的效果了
@RibbonClient(name = "MICRO-SERVICE-DEPT-PROVIDER",configuration = MyRuleConfig.class)
// 启动feign
@EnableFeignClients(basePackages = "com.zhanghe.study")
public class ConsumerApp {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApp.class,args);
    }
}
